package com.apes.framework.plugin.esb.processor.connector.yyerp;

import com.apes.framework.plugin.esb.api.SimpleRequest;
import com.apes.framework.plugin.esb.processor.AbstractChainProcessor;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * 功能：老框架数据包装
 *
 * @author xul
 * @create 2019-11-22 10:27
 */
@Data
public class ApesOldWrapperProcessor<T extends SimpleRequest, R> extends AbstractChainProcessor<T, R> {

    private String method;

    @Override
    protected R doProcess(T request) {
        Map data = new HashMap();
        Map<String, String> headers = new HashMap<>();
        headers.put("method", method);
        data.put("body",request.getData());
        data.put("headers", headers);
        return (R) data;
    }
}
